using MaterialUI;
using UnityEngine;

public class Example09 : MonoBehaviour
{
	[SerializeField]
	private ProgressIndicator[] m_ProgressIndicatorArray;

	public void OnButtonShowClicked()
	{
		ProgressIndicator[] progressIndicatorArray = m_ProgressIndicatorArray;
		foreach (ProgressIndicator progressIndicator in progressIndicatorArray)
		{
			progressIndicator.Show();
		}
	}

	public void OnButtonHideClicked()
	{
		ProgressIndicator[] progressIndicatorArray = m_ProgressIndicatorArray;
		foreach (ProgressIndicator progressIndicator in progressIndicatorArray)
		{
			progressIndicator.Hide();
		}
	}

	public void OnButtonIndeterminateClicked()
	{
		ProgressIndicator[] progressIndicatorArray = m_ProgressIndicatorArray;
		foreach (ProgressIndicator progressIndicator in progressIndicatorArray)
		{
			progressIndicator.StartIndeterminate();
		}
	}

	public void OnButtonRandomProgressClicked()
	{
		float progress = UnityEngine.Random.Range(0f, 1f);
		ProgressIndicator[] progressIndicatorArray = m_ProgressIndicatorArray;
		foreach (ProgressIndicator progressIndicator in progressIndicatorArray)
		{
			progressIndicator.SetProgress(progress);
		}
	}

	public void OnButtonRandomProgressAnimateClicked()
	{
		float progress = UnityEngine.Random.Range(0f, 1f);
		ProgressIndicator[] progressIndicatorArray = m_ProgressIndicatorArray;
		foreach (ProgressIndicator progressIndicator in progressIndicatorArray)
		{
			progressIndicator.SetProgress(progress, animated: false);
		}
	}

	public void OnButtonRandomColorClicked()
	{
		Color randomColor = GetRandomColor();
		ProgressIndicator[] progressIndicatorArray = m_ProgressIndicatorArray;
		foreach (ProgressIndicator progressIndicator in progressIndicatorArray)
		{
			progressIndicator.SetColor(randomColor);
		}
	}

	private Color GetRandomColor()
	{
		return new Color(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f));
	}
}
